package com.example.sunjian.myapplication.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RemoteViewsService;

import com.example.sunjian.myapplication.R;

/**
 * 作者：sunjian on 16/6/7 15:39
 * 邮箱：sunjian@cyhz.com
 */
public class Fragment_2 extends Fragment {


    protected ImageView mImageView;

    String[] str = {"savasvsv","vasvsavasvsave","g32gregerv","qg3frqvsvgregre"};


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragmentlayout_1,null);
        mImageView= (ImageView) view.findViewById(R.id.frag_img);
        ListView listView = (ListView)view.findViewById(R.id.list_view);
        ArrayAdapter adapter = new ArrayAdapter(getActivity(), R.layout.activity_main,R.id.tv,str);
        listView.setAdapter(adapter);
        setImage();
        return view;
    }



    protected void setImage(){
        mImageView.setImageResource(R.drawable.test);

    }
}
